<?php
use app\models\Activity;
use app\models\Job;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;

/* @var $model \app\models\Job */
/* @var $user \app\models\User */
/* @var $this \yii\web\View */
?>
    <style>
        .ui-form-item > .ui-select{
            margin-left:0;
        }
        .ui-form-item select{
            width:100%;
            box-sizing:border-box;
            -webkit-appearance:none;
            border:0;
            background:none;
            padding-left:40px;
            color:#bbb;
        }
    </style>
    <section class="ui-container">

        <div class="ui-form defaultForm">
            <?php $form = ActiveForm::begin(['id' => 'activityForm', 'enableClientScript' => FALSE]); ?>
            <div class="ui-form-item ui-border-b">
                <label class="ico-edit">&nbsp;</label>
                <?= Html::activeTextInput($model, 'title', ['placeholder' => '请输入职位名称', 'data-required' => 'true']); ?>
            </div>

            <div class="ui-form-item ui-border-b">
                <label class="ico-edit">&nbsp;</label>
                <?= Html::activeTextInput($model, 'company', ['placeholder' => '请输入公司名称', 'data-required' => 'true']); ?>
            </div>

            <div class="ui-form-item ui-border-b">
                <label class="ico-edit">&nbsp;</label>
                <?= Html::activeTextInput($model, 'address', ['placeholder' => '请输入地址', 'data-required' => 'true']); ?>
            </div>

            <div class="ui-form-item ui-border-b">
                <label class="ico-edit">&nbsp;</label>
                <?= Html::activeTextInput($model, 'salary', ['placeholder' => '请输入薪资', 'data-required' => 'true']); ?>
            </div>

            <div class="ui-form-item ui-border-b">
                <label class="ico-edit">&nbsp;</label>
                <?= Html::activeTextInput($model, 'job_type', ['placeholder' => '标签', 'data-required' => 'true']); ?>
            </div>

            <div class="ui-form-item ui-border-b">
                <label class="ico-edit">&nbsp;</label>
                <div class="ui-select">
                    <?= Html::activeDropDownList($model, 'city', Job::$cityLabels, ['placeholder' => '请选择城市', 'data-required' => 'true', 'prompt' => '请选择城市']); ?>
                </div>
            </div>

            <div class="ui-form-item ui-border-b">
                <label class="ico-edit">&nbsp;</label>
                <div class="ui-select">
                    <?php if ($model->getIsJob()): ?>

                        <?= Html::activeDropDownList($model, 'work_time', Job::$workLabels, ['placeholder' => '请选择结算方式', 'data-required' => 'true', 'prompt' => '请选择结算方式']); ?>
                    <?php else: ?>
                        <?= Html::activeDropDownList($model, 'work_time', Job::$workLabels, ['placeholder' => '请选择工作时间', 'data-required' => 'true', 'prompt' => '请选择工作时间']); ?>
                    <?php endif; ?>
                </div>
            </div>

            <div class="ui-form-item ui-form-item-title" style="margin-top: 10px;">
                <label class="ico-edit">&nbsp;</label>
                <span>公司介绍</span>
            </div>
            <div class="ui-form-item ui-form-item-textarea">
                <?= Html::activeTextarea($model, 'experience1', ['rows' => 5]); ?>
            </div>

            <div class="ui-form-item ui-form-item-title">
                <label class="ico-edit">&nbsp;</label>
                <span>公司风貌展示</span>
            </div>
            <div class="ui-form-item ui-form-item-textarea">
                <?= Html::activeTextarea($model, 'experience2', ['rows' => 5, 'data-required' => 'true']); ?>
            </div>

            <div class="ui-form-item ui-form-item-title">
                <label class="ico-edit">&nbsp;</label>
                <span>发展历程</span>
            </div>
            <div class="ui-form-item ui-form-item-textarea">
                <?= Html::activeTextarea($model, 'experience3', ['rows' => 5, 'data-required' => 'true']); ?>
            </div>

            <div class="ui-form-item ui-form-item-title">
                <label class="ico-edit">&nbsp;</label>
                <span>岗位职责</span>
            </div>
            <div class="ui-form-item ui-form-item-textarea">
                <?= Html::activeTextarea($model, 'experience4', ['rows' => 5, 'data-required' => 'true']); ?>
            </div>

            <div class="ui-form-item ui-form-item-title">
                <label class="ico-edit">&nbsp;</label>
                <span>任职要求</span>
            </div>
            <div class="ui-form-item ui-form-item-textarea">
                <?= Html::activeTextarea($model, 'experience5', ['rows' => 5, 'data-required' => 'true']); ?>
            </div>

            <div class="ui-form-item ui-form-item-title"><label class="ico-edit">&nbsp;</label><span>上传图片</span></div>
            <div class="ui-form-item ui-form-item-textarea">
                <div class="uploader__bd">
                    <ul class="uploader__files" id="uploaderFiles">
                    </ul>
                    <div class="uploader__input-box">
                        <button type="button" id="uploaderInput" class="uploader__input"></button>
                    </div>
                </div>
            </div>
            <div class="ui-btn-wrap">
                <button data-redirect="<?= Url::to(['user/publish']); ?>" class="loginSubmit" type="submit">发布</button>
            </div>
            <?php ActiveForm::end(); ?>
        </div>
    </section>
<?= \app\widgets\WxJsWidget::widget(); ?>